<?php
session_start( );
?>
<?php
if (!isset($_SESSION['regid'] )) {
header("location: frmm.php");
}

require_once('connections/mysqlDB.php');
require('smarty_connect.php');
$rid = $_SESSION['rid'];
$regid = $_SESSION['regid'];
//$rid=10020;
$_SESSION['rid'] = $rid;
$_SESSION['regid'] = $regid;

$smarty = new smarty_connect;
$dbConn = new mysqli(HOST,USER,PWD,DB);
if (mysqli_connect_errno()) { die('Connect failed: ' . mysqli_connect_error()); }  

$dbConn->query("SET NAMES 'utf8'");

$stmt1 = $dbConn->query("select cname,first_name,last_name,first_time,pastoral_staff,
(select description from code where abbrev = relationship) as relationship,
gender,(select description from code where abbrev = groups) as groups,
(select description from code where abbrev = special_need) as special_need,
meal1,meal2,meal3,meal4,meal5,meal6,meal7,meal8,session1,session2,
session3,session4,session5,session6,session7,session7,session8,session9,
session10,session11 
from registration_info where rid= $rid order by reginfoid");
$data=array();
while ($row = $stmt1->fetch_assoc()) {
$data[]=$row;
};
$stmt1->close();
$dbConn->close();

//var_dump($data);
$smarty->assign("foreign",$_SESSION['foreign']);
$smarty->assign("regid",$regid);
$smarty->assign("rid",$rid);
$smarty->assign('data',$data);
$smarty->display('con_nextpage.tpl');

?>
